package cn.tedu.api;

import java.io.File;

public class T5_file {
    public static void main(String[] args) {
        File file =new File("F:\\好好学习");
        File []f = file.listFiles();
        long sum = 0;
        for (int i = 0; i <f.length ; i++) {
            if(f[i].isDirectory()){
                System.out.println(f[i].getName());
            }
            else{
                sum = f[i].length()+ sum;
            }
        }
        System.out.println(sum);
    }
}
